from django.contrib import admin
from ehmn2.models import *
class ReactionAdmin(admin.ModelAdmin):
#    date_hierarchy = 'pathway'
    list_display = ('reactionid', 'pathway', 'reversibility', 'equation')
    list_per_page = 100
    list_filter = ('pathway',)
#    fields= ('reactionid', 'pathway', 'reversibility', 'equation')
#    ordering = ('pathway', 'reactionid',)
    search_fields = ('reactionid','eq_in_id','equation',)         
    pass

class PathwayAdmin(admin.ModelAdmin):
        list_display = ('pathid', 'name', 'category', )
#        list_editable = ('pathid', 'name', 'category', )
        ordering = ('pathid',)
        search_fields = ('name',)         
        pass

class Met_linkAdmin(admin.ModelAdmin):
        list_display = ('id','com1', 'com2','rea',)
        list_per_page = 100
        ordering = ('id',)
        search_fields = ('com1__compoundid','com2__compoundid','rea__reactionid',)         
        pass

admin.site.register(Pathway, PathwayAdmin)
#admin.site.register(Pathway)
admin.site.register(Reaction, ReactionAdmin)
admin.site.register(Met_link, Met_linkAdmin)
admin.site.register(Rea_gene)
admin.site.register(Rea_ec)
admin.site.register(Gene_ec)
admin.site.register(Compound)
